﻿<div>
    <AutoComplete @bind-Value="@value" Options="@options" OnInput="OnInput"/>
</div>
<Divider></Divider>
<span>bind-Value:@value</span>

@code
{
    private string value;

    List<string> options = new List<string>();


    void OnInput(ChangeEventArgs e)
    {
        var value = e.Value?.ToString() ?? "";
        if (string.IsNullOrWhiteSpace(value) || value.IndexOf("@") >= 0)
        {
            this.options = new List<string>();
        }
        else
        {
            this.options = new List<string>() { "gmail.com", "163.com", "qq.com" }.Select(x => $"{value}@{x}").ToList();
        }
    }
}